package nl.uva.science.pico.picolanguage;

abstract public class AbstractList extends aterm.pure.ATermListImpl {
  private nl.uva.science.pico.picolanguage.Factory abstractTypeFactory;

  public AbstractList(nl.uva.science.pico.picolanguage.Factory abstractTypeFactory, aterm.ATermList annos, aterm.ATerm first, aterm.ATermList next) {
    super(abstractTypeFactory.getPureFactory(), annos, first, next);
    this.abstractTypeFactory = abstractTypeFactory;
  }

  abstract public aterm.ATerm toTerm();

  public String toString() {
    return toTerm().toString();
  }

  public nl.uva.science.pico.picolanguage.Factory getPicoLanguageFactory() {
    return abstractTypeFactory;
  }

  public boolean isSortNormal() {
    return false;
  }

  public boolean isSortEscaped() {
    return false;
  }

  public boolean isSortStrCon() {
    return false;
  }

  public boolean isSortBoolCon() {
    return false;
  }

  public boolean isSortNatCon() {
    return false;
  }

  public boolean isSortTYPE() {
    return false;
  }

  public boolean isSortPICOID() {
    return false;
  }

  public boolean isSortSTATEMENTS() {
    return false;
  }

  public boolean isSortDECLARATIONS() {
    return false;
  }

  public boolean isSortPROGRAM() {
    return false;
  }

  public boolean isSortDECLS() {
    return false;
  }

  public boolean isSortIDTYPE() {
    return false;
  }

  public boolean isSortSTATEMENT() {
    return false;
  }

  public boolean isSortEXP() {
    return false;
  }

  public boolean isSortSTATEMENTList() {
    return false;
  }

  public boolean isSortIDTYPEList() {
    return false;
  }

  public boolean isEmpty() {
    return getFirst()==getEmpty().getFirst() && getNext()==getEmpty().getNext();
  }

  public boolean isMany() {
    return !isEmpty();
  }

  public boolean isSingle() {
    return !isEmpty() && getNext().isEmpty();
  }

  public boolean hasHead() {
    return !isEmpty();
  }

  public boolean hasTail() {
    return !isEmpty();
  }

}
